package demo;

import java.util.Random;

public class Text28 {
    public static void main(String[] args) {
        int[] arr = new int[10];
        Random r = new Random();
        for (int i = 0; i < arr.length; i++) {
            arr[i] = r.nextInt(100) + 1;
       /* }
        for (int i = 0; i < arr.length; i++) {*/
            System.out.print(arr[i]+" ");
        }
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum = sum + arr[i];
        }
        double avg=0;
        for (int i = 0; i < arr.length; i++) {
            avg=sum/arr.length;
        }int count=0;
        for (int i = 0; i < arr.length; i++) {
            if(arr[i]<avg){
                count++;
            }
        }
        System.out.println();
        System.out.println("和："+sum);
        System.out.println("平均值："+avg);
        System.out.println("比平均值小的有"+count+"个");
    }

        /*生成10个1-100的随机数存入数组
        求和、求平均值、统计比平均数小的数*/

    }






